class CreateSqlinfobifs < ActiveRecord::Migration
  def self.up
    create_table :sqlinfobifs do |t|
      t.column :org_code,     :string, :limit => 2, :default => " ", :null => false
      t.column :act_ref,      :string, :limit => 10, :default => " ", :null => false
      t.column :financial_year, :string, :limit => 4, :default => " ", :null => false
      t.column :payment_dt,   :date,   :default => "2000-01-01", :null => false      
      t.column :user_ref,     :string, :limit => 100, :default => " ", :null => false
      t.column :description,  :string, :limit => 100, :default => " ", :null => false
      t.column :source,       :string, :limit => 12, :default => " ", :null => false
      t.column :amount,       :decimal,  :default => 0, :null => false, :precision => 20, :scale => 2
      t.column :recovery_ctl_yr,  :string, :limit => 10, :default => " ", :null => false
      t.column :recovery_clt_no,  :string, :limit => 10, :default => " ", :null => false
      t.column :place_ref,    :string, :limit => 100, :default => " ", :null => false
      t.column :module,       :string, :limit => 1, :default => " ", :null => false
      t.column :invoice_number,       :string, :limit => 10, :default => " ", :null => false      
    end
  end

  def self.down
    drop_table :sqlinfobifs
  end
end
